package com.gec.zhs.entity.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gec.zhs.entity.enums.DateTimePatternEnum;
import com.gec.zhs.utils.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * @author zhs
 * @version 1.0
 * @date 2025-01-06
 * @description  视频弹幕
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class VideoDanmu implements Serializable {


    /**
     * 自增ID
     */
    private Integer danmuId;

    /**
     * 视频ID
     */
    private String videoId;

    /**
     * 唯一ID
     */
    private String fileId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date postTime;

    /**
     * 内容
     */
    private String text;

    /**
     * 展示位置
     */
    private Integer mode;

    /**
     * 颜色
     */
    private String color;

    /**
     * 展示时间
     */
    private Integer time;

    /**
     * 视频名称
     */
    private String videoName;

    /**
     * 视频内容
     */
    private String videoCover;

    /**
     * 用户昵称
     */
    private String nickName;


    @Override
    public String toString() {
        return "自增ID:" + (danmuId == null ? "空" : danmuId) + "，视频ID:" + (videoId == null ? "空" : videoId) + "，唯一ID:" + (fileId == null ? "空" : fileId) + "，用户ID:" + (userId == null ? "空" : userId) + "，发布时间:" + (postTime == null ? "空" : DateUtil.format(
                postTime,
                DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern())) + "，内容:" + (text == null ? "空" : text) + "，展示位置:" + (mode == null ? "空" : mode) + "，颜色:" + (color == null ? "空" : color) +
                "，展示时间:" + (time == null ? "空" : time);
    }
}
